print("Ввидите скобочную последовательность, из (){}[]<>")
a = input()
s = ""
for i in range(len(a)):
    if a[i] in "([{<":
        s += a[i]
    else:
        a[i] == "(" and s[-1] == ")" or \
        a[i] == "{" and s[-1] == "}" or \
        a[i] == "<" and s[-1] == ">" or \
        a[i] == "[" and s[-1] == "]":
            s = s[:-1]
if len(s) == 0 and len(a) % 2 == 0:
    print("True")
else:
    print("False")
